<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>account</title>

    <link rel="stylesheet" href="./bootstrap/dist/css/bootstrap.min.css">

    <script src="./jquery/dist/jquery.min.js"></script>

    <script src="./bootstrap/dist/js/bootstrap.min.js"></script>


    <script src="./vue/dist/vue.min.js"></script>
    <!--<script src="./moment/moment.js"></script>-->
    <!--<script src="./moment/locale/zh-cn.js"></script>-->

    <style>
        body {
            background-color: #8fd19e;
        }
    </style>

</head>

<body>

    <div class="container" id="timeCardApp">

        <div class="card" style="margin:10px; width: 400px;">
            <!-- <img class="card-img-top" src="navi.jpeg" style="height:100px;" alt=""> -->
            <div class="card-body">
                <h4 class="card-title">others</h4>


                <form>

                    <div class="form-group">
                      <label for="">year</label>
                      <input type="number" v-model="timeCardDataForm.year" class="form-control">
                    </div>

                    <div class="form-group">
                      <label for="">month</label>
                      <input type="number" name="" v-model="timeCardDataForm.month" class="form-control">
                    </div>

                    <button type="button" @click="fnDownloadExcel()" class="btn btn-primary">download excel</button>

                </form>
                

            </div>
        </div>



    </div>


</body>

</html>


<script>




    var vm = new Vue({
        el: '#timeCardApp',
        data: {

            timeCardDataForm: {
                year: '',
                month: '',
            },




        },



        methods: {

            initYearMonth(){

                var date = new Date();
                let year = date.getFullYear();
                let month = date.getMonth() + 1;

                this.timeCardDataForm.year = year;
                this.timeCardDataForm.month = month;

            },

            fnDownloadExcel(){

                var year = this.timeCardDataForm.year;
                var month = this.timeCardDataForm.month;

                window.open(`file-items/time-card/${year}/${month}`);
            }


        },
        mounted() {

            this.initYearMonth();
        }
    })






</script>